/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package queenb.web.store;

import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.jdbc.OracleTypes;
import queenb.net.datacontrol.DataStatement;
import queenb.net.datacontrol.Param;
import queenb.net.entitybean.V180;
import queenb.web.util.PackageContants;

/**
 *
 * @author VANANH
 */
public class V180Store extends V180 {

    public List<V180> vcurpks_listoftabv180(int pnFV050, int pnFN100, int pnPV150, int pnOFFSET, int pnLIMIT, int pnOFF, int pnODD, String pvLOGIN) throws SQLException, InstantiationException, IllegalAccessException {
        DataStatement dataStatement = new DataStatement(PackageContants.vcurpks_listoftabv180, OracleTypes.CURSOR, new Param[]{
                    new Param(OracleTypes.INTEGER, pnFV050),
                    new Param(OracleTypes.INTEGER, pnFN100),
                    new Param(OracleTypes.INTEGER, pnPV150),
                    new Param(OracleTypes.INTEGER, pnOFFSET),
                    new Param(OracleTypes.INTEGER, pnLIMIT),
                    new Param(OracleTypes.INTEGER, pnOFF),
                    new Param(OracleTypes.INTEGER, pnODD),
                    new Param(OracleTypes.CHAR, pvLOGIN)
                });

        return super.find(dataStatement, V180.class);
    }

//    public List<SelectItem> getCitySelect(String pnV180, int pn750) throws SQLException, InstantiationException, IllegalAccessException {
//        List<V180> listV180 = getListCity(pnV180, pn750);
//        List<SelectItem> listSelect = new ArrayList<SelectItem>();
//        for (int i = 0; i < listV180.size(); i++) {
//            V180 a000 = listV180.get(i);
//            listSelect.add(new SelectItem(a000.getPa000(), a000.getAv001()));
//        }
//
//        return listSelect;
//    }
    public int stdv_tools_inserttabv180(int pnPV180, String pvVV181, String pvVV182,int FV050, int pnFV150, int pnFN100, String pvLOGIN) {
        try {
            DataStatement updateStatement = new DataStatement(PackageContants.stdv_tools_inserttabv180, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV180),
                        new Param(OracleTypes.CHAR, pvVV181),
                        new Param(OracleTypes.CHAR, pvVV182),
                         new Param(OracleTypes.INTEGER, FV050),
                        new Param(OracleTypes.INTEGER, pnFV150),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvLOGIN)});
            return super.update(updateStatement, V180.class);
        } catch (SQLException ex) {

            return 0;
        }

    }

    public int stdv_tools_stornotabv180(int pnPV180, int pnFN100, String pvLOGIN) {
        try {
            DataStatement dataStatement = new DataStatement(PackageContants.stdv_tools_stornotabv180, OracleTypes.INTEGER, new Param[]{
                        new Param(OracleTypes.INTEGER, pnPV180),
                        new Param(OracleTypes.INTEGER, pnFN100),
                        new Param(OracleTypes.CHAR, pvLOGIN)
                    });
            return super.update(dataStatement, V180.class);
        } catch (SQLException ex) {
            Logger.getLogger(V180Store.class.getName()).log(Level.SEVERE, null, ex);
            return 0;
        }

    }
}
